package br.com.musclebook.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "CURRENT_ROUTINE")
public class UserCurrentRoutine implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @OneToOne
    @JoinColumn(name = "USER_ID")
    private User user;

    @OneToOne
    @JoinColumn(name = "ROUTINE_ID")
    private Routine routine;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "START")
    private Date start;
    
    public UserCurrentRoutine() {}

    public UserCurrentRoutine(User user, Routine routine, Date start) {
	this.user = user;
	this.routine = routine;
	this.start = start;
    }
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Routine getRoutine() {
        return routine;
    }

    public void setRoutine(Routine routine) {
        this.routine = routine;
    }

    public Date getStart() {
        return start;
    }

    public void setStart(Date startDate) {
        this.start = startDate;
    }
    
}
